package com.lu.core.support;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program lu-boot-saas
 * @description: 数据范围权限 - 代理处理
 * @author: zhanglu
 * @create: 2022-09-27 19:31:00
 */
public class DataScopeProxy {

    public static final InheritableThreadLocal<DataScope> DATA_SCOPE_EXECUTE = new InheritableThreadLocal<>();

    public static void executeConfig(DataScope scope){
        DATA_SCOPE_EXECUTE.set(scope);
    }

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class DataScope{
        private String name;
        private String groupBy;
        private Class<? extends DataScopePermissionAbstract> handler;
    }

}
